package com.woniuxy.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.woniuxy.dao.RewardsMapper;
import com.woniuxy.pojo.Rewards;
import com.woniuxy.service.RewardsService;
@Service
@Transactional
public class RewardsServiceImpl implements RewardsService {
	@Autowired
	private RewardsMapper rewardsMapper;

	@Override
	public List<Rewards> getAll(Integer id) {
		// TODO Auto-generated method stub
		return rewardsMapper.getAllRewards(id);
	}

	@Override
	public void addRewards(Rewards rewards) {
		// TODO Auto-generated method stub
		rewardsMapper.addRewards(rewards);
	}

	@Override
	public void delRewards(Integer id) {
		// TODO Auto-generated method stub
		rewardsMapper.delRewards(id);
	}

	@Override
	public void updateRewards(Rewards rewards) {
		// TODO Auto-generated method stub
		rewardsMapper.updateRewards(rewards);
	}

	@Override
	public List<Rewards> findByType(String type) {
		// TODO Auto-generated method stub
		return rewardsMapper.findByType(type);
	}

	@Override
	public int deleteManyByIds(String ids) {
		// TODO Auto-generated method stub
		return rewardsMapper.deleteManyByIds(ids);
	}

	@Override
	public Rewards getRewardsByCid(Integer cid) {
		// TODO Auto-generated method stub
		return rewardsMapper.selectOneByCid(cid);
	}

	@Override
	public void saveUpdate(Rewards rewards) {
		// TODO Auto-generated method stub
		rewardsMapper.updateRewards(rewards);
		
	}

}
